<!-- 导航URL -->
<div class="row wrapper border-bottom white-bg page-heading">
    <div class="col-md-12">
        <ol class="breadcrumb">
            <li><a>主页</a></li>
            <li><a>三方授权</a></li>
            <li class="active"><strong>顶层代理商管理</strong></li>
        </ol>
    </div>
</div>

<!-- 主要内容 -->
<div class="wrapper wrapper-content animated fadeIn" ng-app
     ng-controller="topAgentManagementCtrl">
    <form class="form-horizontal" id="form1">
        <div class="row">
            <div class="col-lg-12">
                <div class="tabs-container tab_other">
                    <div class="panel-body ibox float-e-margins">
                        <div class="ibox-title">
                            <h5>顶层代理商管理</h5>
                        </div>
                        <div class="ibox-content">
                            <div class="form-group">
                                <label class="col-sm-2 control-label">代理商:</label>
                                <div class="col-sm-2">
                                    <select  name="agent_authorized" id="autocomplete-select2"
                                             ng-model="baseInfo.agent_authorized" ng-options="x.value as x.text for x in oneAgentListA"
                                             style="width: 100%" chosen chosen-data="agent_authorized" chosen-keyup="getOneStatesA">
                                    </select>
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-lg-12">
                                    <div class="col-sm-2"></div>
                                    <div class="col-sm-10">
                                        <button class="btn btn-primary6 btn-mr20" ng-click="query()">查询</button>
                                        <button class="btn btn-primary3 btn-mr20" type="button" ng-click="resetForm()">清空</button>
                                        <button class="btn btn-new btn-mr20" type="button" ng-click="addRecordModal()">新增</button>
                                        <a class="btn btn-primary4" type="button" ui-sref="func.queryAuthList">返回</a>
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="ibox float-e-margins">
                            <div class="ibox-content">
                                <div class="gridStyle" ui-grid="agentTopGrid" ui-grid-selection ui-grid-pinning ui-grid-pagination ui-grid-resize-columns></div>
                                <div ng-show="loadImg" class="timg"></div>
                            </div>
                            <div style="clear: both; height: 30px;"></div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </form>
    <div id="addRecordModal" class="modal fade form-horizontal" tabindex="3" role="dialog">
        <div class="modal-dialog" style="height:300px;width: 700px">
            <div class="modal-content" style="height:300px;width: 750px">
                <form class="form-horizontal" name="horizontal">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">&times;</button>
                        <h3 class="modal-title" id="opTypeTitle"></h3>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <input type="hidden" ng-model="addRecordData.record_code">
                            <label class="col-sm-3 control-label">代理商编号：</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" ng-model="addRecordData.agent_authorized" ng-blur="getAgent()" required="required">
                            </div>
                            <label class="col-sm-3 control-label">代理商名称：</label>
                            <div class="col-sm-3">
                                <input type="text" class="form-control" ng-model="addRecordData.agent_authorized_name" readonly required="required">
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <div class="form-group control-label">
                            <label class="col-sm-2 control-label"></label>
                            <div class="col-sm-6">
                                <button class="btn btn-primary btn-mr20" type="button" ng-click='addRecord()'>确定</button>
                                <button class="btn btn-primary8" type="button" ng-click='cancel()' >返回</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
